package com.phgame.newsmth.ui;

import com.phgame.newsmth.R;
import com.phgame.newsmth.pploader.pploader;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.util.LruCache;
import android.text.Layout;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.LinearLayout.LayoutParams;

public class MainTestActivity extends Activity {
	
	private static final  String url = "http://su.bdimg.com/static/superplus/img/logo_white_ee663702.png";
	@Override
	public void onCreate(Bundle bundle){
		super.onCreate(bundle);
		//LayoutInflater inflater = this.getLayoutInflater();
		LinearLayout layout = new LinearLayout(this);
		LayoutParams params = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
		layout.setOrientation(LinearLayout.VERTICAL);
		pploader loader = new pploader(this);
		for (int i = 0; i < 2; i++) {
			
			ImageView view = new ImageView(this);
			LayoutParams childparams = new LayoutParams(1000, 200);
			childparams.setMargins(0,0,0,20);
			view.setBackgroundColor(Color.RED);
			loader.loadImage(url, view);
			view.setLayoutParams(childparams);
			
			layout.addView(view);
			//this.addContentView(view, params);
		}
		this.addContentView(layout, params);

		
	}
}
